[#if result.items ??]
    <table class="table noBorder">
        <thead>
        <tr>
            <th style="width: 15%;">产品类目</th>
            <th style="width: 15%;">商品名称 </th>
            <th style="width: 10%;">品牌</th>
            <th style="width: 10%;">型号</th>
            <th style="width: 10%;">数量</th>
            <th style="width: 10%;">单位</th>
            <th style="width: 10%;">单价</th>
            <th style="width: 10%;">技术参数</th>
            <th style="width: 10%;">删除</th>
        </tr>
        </thead>
        <tbody id="listitembody">
        [#assign totalPrice = 0]
        [#list result.items as item]
        <tr>
            <input type="hidden" name="itemids"  value="${item.id!}" />
            <td style="width: 15%;">${item.categoryName!}</td>
            <td style="width: 15%;overflow: hidden; word-break: break-all;  text-overflow: ellipsis;" title="${item.productName!}">${item.productName!}</td>
            <td style="width: 10%;">${item.brand!}</td>
            <td style="width: 10%;">${item.model!}</td>
            <td style="width: 10%;" class="quantity">${item.quantity!}</td>
            <td style="width: 10%;">${item.unit!}</td>
            <td style="width: 10%;">￥<label class="unitprice">${item.unitprice!}</label></td>
            [#assign totalPrice = totalPrice + (item.totalPrice!0)]
            <input class="itemTotal" value="${item.totalPrice!0}" type="hidden"/>
            <td style="width: 10%;" title="${item.descr!}">[@content_cut content=item.descr! len=20 ending="..."/]</td>
            <td style="width: 10%;" class="del listDel"></td>
            <input type="hidden" name="item[${item_index}].enquiryItemId" value="${item.enquiryItemId!}">
            <input type="hidden" name="item[${item_index}].productName" value="${item.productName!}">
            <input type="hidden" name="item[${item_index}].brand" value="${item.brand!}">
            <input type="hidden" name="item[${item_index}].model" value="${item.model!}">
            <input type="hidden" name="item[${item_index}].unit" value="${item.unit!}">
            <input type="hidden" name="item[${item_index}].quantity" value="${item.quantity!}">
            <input type="hidden" name="item[${item_index}].unitprice" value="${item.unitprice!}">
            <input type="hidden" name="item[${item_index}].totalPrice" value="${item.totalPrice!}">
            <input type="hidden" name="item[${item_index}].descr" value="${item.descr!}">
            <input type="hidden" name="item[${item_index}].categorySId" value="${item.categorySId!}">
            <input type="hidden" name="item[${item_index}].enquiryId" value="${result.enquiryId!}">
            <input type="hidden" name="item[${item_index}].projectId" value="${result.projectId!}">
            <input type="hidden" name="item[${item_index}].quoteId" value="${result.quoteId!}">
        </tr>
        [/#list]
        </tbody>
        <tfoot>
        <tr class="tableBorde">
            <td class="fenye ppTfoot" colspan="9"
                style="background: #f8f8f8; padding:15px;">
                <div style="float: right;">
                    <dfn id="listTotal">
                        清单总计： &nbsp;&nbsp;&nbsp;<span class="listcontentBold">${totalPrice!0}</span>元
                    </dfn>
                    <!--<dfn>-->
                    <!--优惠价： &nbsp;&nbsp;&nbsp;<input type="text"/>元-->
                    <!--</dfn>-->
                    <!--<button class="commitButt" type="button" id="goUploadAgain">重新上传</button>-->
                </div>
            </td>
        </tr>
        </tfoot>
        <input type="hidden" id="listtotalPrice" name="listtotalPrice" value="${totalPrice!0}" />
    </table>
[/#if]
<script>
    $(function () {
        layer.closeAll();
        var msg = "${result.msg!}";
        if(msg != '') {
            layer.alert(msg , {icon:3});
        }

        $(".listDel").on('click' , function () {
            var $this = $(this);
//            if($("#itembody tr").length == 1){layer.alert("不能删除所有清单内容");return false;}
            var lc = layer.confirm("是否确认删除此列清单内容？" , {icon : 3 , title : "提示"} , function () {
                $this.parent().remove();
                var totalprice = 0;
                $("#listitembody tr").each(function(){
                    var ut = Number($(this).find(".itemTotal").val());
                    totalprice += ut;
                });
                console.log(totalprice);
                $(".listcontentBold").text(Number(decimal(decimal(totalprice,6),2)));
                $("#listtotalPrice").val(Number(decimal(decimal(totalprice,6),2)));
                layer.close(lc);
            });
        });
    });

    //对多位小数进行四舍五入
    //num是要处理的数字  v为要保留的小数位数
    function decimal(num,v){
        var vv = Math.pow(10,v);
        return Math.round(num*vv)/vv;
    }
</script>